package com.bupt.kgplatform.Util;

import com.bupt.kgplatform.entity.User;

/**
 * UserHolder
 *
 * @author zrz
 * @date 2024/5/20
 * @time 13:05
 * @Description ss
 */
public class UserHolder {
    private static final ThreadLocal<Integer> tl = new ThreadLocal<>();
    public static void setUser(int userId){
        tl.set(userId);
    }

    public static Integer getUser(){
        return tl.get();
    }
    public static void removeUser(){
        tl.remove();
    }

}
